Skip to content

Commit

Permalink
Merge pull request #54 from rossburton/test
Browse files Browse the repository at this point in the history
Clean up test runner
  • Loading branch information
stefankoegl committed Jun 16, 2023
2 parents eae86db + 04a864f commit 8a08c4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ help:
@echo

test:
python tests.py
python -munittest

coverage:
coverage run --source=jsonpointer tests.py
Expand Down
24 changes: 4 additions & 20 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import unittest
import sys
import copy
import jsonpointer
from jsonpointer import resolve_pointer, EndOfList, JsonPointerException, \
JsonPointer, set_pointer

Expand Down Expand Up @@ -410,23 +411,6 @@ def test_mock_dict_raises_key_error(self):
self.assertRaises(JsonPointerException, resolve_pointer, doc, '/root/1/2/3/4')



suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(SpecificationTests))
suite.addTest(unittest.makeSuite(ComparisonTests))
suite.addTest(unittest.makeSuite(WrongInputTests))
suite.addTest(unittest.makeSuite(ToLastTests))
suite.addTest(unittest.makeSuite(SetTests))
suite.addTest(unittest.makeSuite(AltTypesTests))

modules = ['jsonpointer']

for module in modules:
m = __import__(module, fromlist=[module])
suite.addTest(doctest.DocTestSuite(m))

runner = unittest.TextTestRunner(verbosity=1)
result = runner.run(suite)

if not result.wasSuccessful():
sys.exit(1)
def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite(jsonpointer))
return tests

0 comments on commit 8a08c4b

Please sign in to comment.