From bec47f91e2f5a5a76f9f10416696258b7fbd103f Mon Sep 17 00:00:00 2001 From: IlgarLunin Date: Thu, 7 Feb 2019 19:36:31 +0300 Subject: [PATCH] unit test runner under debugger --- .vscode/launch.json | 7 +++++++ .vscode/settings.json | 11 ++++++++++- PyFlow/Tests/TestGeneral.py | 4 ++++ unittest_runner.py | 7 +++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 unittest_runner.py diff --git a/.vscode/launch.json b/.vscode/launch.json index fb34b7b3a..35f9f8c93 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,6 +11,13 @@ "program": "${workspaceFolder}/launcher.py", "console": "integratedTerminal" }, + { + "name": "Python: PyFlow unittest", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/unittest_runner.py", + "console": "integratedTerminal" + }, { "name": "Python: PyFlow debug", "type": "python", diff --git a/.vscode/settings.json b/.vscode/settings.json index 18c002a3c..0f0f72717 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,12 @@ { - "python.pythonPath": "C:\\Python3\\python.exe" + "python.pythonPath": "C:\\Python37\\python.exe", + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.pyd": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/__pycache__": true, + } } \ No newline at end of file diff --git a/PyFlow/Tests/TestGeneral.py b/PyFlow/Tests/TestGeneral.py index 0c869b127..bac16b41c 100644 --- a/PyFlow/Tests/TestGeneral.py +++ b/PyFlow/Tests/TestGeneral.py @@ -19,3 +19,7 @@ def test_add_int(self): edge = g.addEdge(addNode1.getPinByName('out', PinSelectionGroup.Outputs), addNode2.getPinByName('a', PinSelectionGroup.Inputs)) self.assertIsNotNone(edge, "FAILED TO ADD EDGE") self.assertEqual(addNode2.getData('out'), 5, "NODES EVALUATION IS INCORRECT") + + +if __name__ == '__main__': + unittest.main() diff --git a/unittest_runner.py b/unittest_runner.py new file mode 100644 index 000000000..ddca42e58 --- /dev/null +++ b/unittest_runner.py @@ -0,0 +1,7 @@ +import unittest + + +if __name__ == "__main__": + loader = unittest.TestLoader() + suite = loader.discover("PyFlow/Tests") + unittest.TextTestRunner().run(suite)