There is a python that says "unittest"?@classmethod?

Asked 2 years ago, Updated 2 years ago, 19 views

https://github.com/wylee/Dijkstar/blob/master/dijkstar/tests/test_graph.py
Please tell me how to run cls.graph data.
I did, but nothing is displayed.
If possible, a full script would be helpful.Thank you for your cooperation.

python

2022-09-30 19:22

1 Answers

test_graph.py is a unit test module, but python test_graph.py does nothing because there is no code to execute.Now start the test from the command line.For example, you can test with the following commands:

 python-unit test tests/test_graph.py

·Reference Official Document unittest 26.4.2. Command Line Interface

Also, @classmethod is used, but I don't think this question is very important, so setUpClass() is the method called before the test runs, and tearDownClass() is the method called after the test runs.


2022-09-30 19:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.