File tree Expand file tree Collapse file tree 3 files changed +23
-14
lines changed Expand file tree Collapse file tree 3 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 2626# end::minimal-example-import[]
2727
2828
29- class MinimalWorkingExampleTestCase (TestCase ):
29+ class FreshDatabaseTestCase (TestCase ):
3030
3131 def setUp (self ):
3232 session = GraphDatabase .driver ("bolt://localhost" ).session ()
3333 session .run ("MATCH (n) DETACH DELETE n" ).close ()
3434 session .close ()
3535
36+
37+ class MinimalWorkingExampleTestCase (FreshDatabaseTestCase ):
38+
3639 def test_minimal_working_example (self ):
3740 # tag::minimal-example[]
3841 driver = GraphDatabase .driver ("bolt://localhost" )
@@ -49,12 +52,7 @@ def test_minimal_working_example(self):
4952 # end::minimal-example[]
5053
5154
52- class ExamplesTestCase (TestCase ):
53-
54- def setUp (self ):
55- session = GraphDatabase .driver ("bolt://localhost" ).session ()
56- session .run ("MATCH (n) DETACH DELETE n" ).close ()
57- session .close ()
55+ class ExamplesTestCase (FreshDatabaseTestCase ):
5856
5957 def test_construct_driver (self ):
6058 # tag::construct-driver[]
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ echo "Running tests with $(python --version)"
6262pip install --upgrade -r ${DRIVER_HOME} /test_requirements.txt
6363echo " "
6464TEST_RUNNER=" coverage run -m ${UNITTEST} discover -vfs ${TEST} "
65+ EXAMPLES_RUNNER=" coverage run -m ${UNITTEST} discover -vfs examples"
6566BEHAVE_RUNNER=" behave test/tck"
6667if [ ${RUNNING} -eq 1 ]
6768then
7071else
7172 neokit/neorun ${NEORUN_OPTIONS} " ${TEST_RUNNER} " ${VERSIONS}
7273 EXIT_STATUS=$?
73- if [ ${EXIT_STATUS} -eq 0 ]
74+ if [ ${EXIT_STATUS} -ne 0 ]
7475 then
75- coverage report --show-missing
76- python -c ' from test.tck.configure_feature_files import *; set_up()'
77- echo " Feature files downloaded"
78- neokit/neorun ${NEORUN_OPTIONS} " ${BEHAVE_RUNNER} " ${VERSIONS}
79- python -c ' from test.tck.configure_feature_files import *; clean_up()'
80- echo " Feature files removed"
76+ exit ${EXIT_STATUS}
8177 fi
78+
79+ neokit/neorun ${NEORUN_OPTIONS} " ${EXAMPLES_RUNNER} " ${VERSIONS}
80+ EXIT_STATUS=$?
81+ if [ ${EXIT_STATUS} -ne 0 ]
82+ then
83+ exit ${EXIT_STATUS}
84+ fi
85+
86+ coverage report --show-missing
87+ python -c ' from test.tck.configure_feature_files import *; set_up()'
88+ echo " Feature files downloaded"
89+ neokit/neorun ${NEORUN_OPTIONS} " ${BEHAVE_RUNNER} " ${VERSIONS}
90+ python -c ' from test.tck.configure_feature_files import *; clean_up()'
91+ echo " Feature files removed"
92+
8293fi
8394
8495# Exit correctly
You can’t perform that action at this time.
0 commit comments