From 0c6752168aace87cd99a0e9bf87b1340902a9f12 Mon Sep 17 00:00:00 2001 From: Machiel Groeneveld Date: Mon, 7 Oct 2019 14:28:55 +0200 Subject: [PATCH] Update README.md --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c999c27..79e9cf1 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,30 @@ Behave BDD and Unit testing utilities for easy and fast tests in pyspark The base unit test class creates an in memory derby DB and any warehouse files -are written to a unique directory to avoid clashes between tests \ No newline at end of file +are written to a unique directory to avoid clashes between tests + +# Installation +``` +pip install sparkle-test +``` + +# Usage +Simply subclass the SparkleTestCase + +```python +from sparkle_test import SparkleTestCase + +class SparkleTestCaseTest(SparkleTestCase): + + def test_something(self): + print(self.spark.version) +``` + +You can optionally set specific settings for custom jars, packages and repositories: +```python +class SparkleTestCaseTest(SparkleTestCase): + jars = ['src/unittest/resources/foo.jar'] + packages = ['com.databricks:spark-csv_2.10:1.4.0'] + repositories = ['http://nexus.foo.com'] + options = {'spark.foo': 'bar'} +```