-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* migrate unittest to pytest * add custom graphical marker * fix docstrings * review actions
- Loading branch information
Showing
5 changed files
with
210 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright Tephi contributors | ||
# | ||
# This file is part of Tephi and is released under the LGPL license. | ||
# See COPYING and COPYING.LESSER in the root of the repository for full | ||
# licensing details. | ||
"""pytest configuration""" | ||
|
||
import matplotlib.pyplot as plt | ||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def close_plot(): | ||
"""This fixture closes the current matplotlib plot associated with the graphical test. | ||
""" | ||
yield | ||
plt.close() | ||
|
||
|
||
@pytest.fixture | ||
def nodeid(request): | ||
"""This fixture returns the unique test name for the method. | ||
Constructs the nodeid, which is composed of the test module name, | ||
class name, and method name. | ||
Parameters | ||
---------- | ||
request : fixture | ||
pytest built-in fixture providing information of the requesting | ||
test function. | ||
Returns | ||
------- | ||
str | ||
The test nodeid consisting of the module, class and test name. | ||
""" | ||
root = request.fspath.basename.split(".")[0] | ||
klass = request.cls.__name__ | ||
func = request.node.name | ||
return ".".join([root, klass, func]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.