Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test failure (test_version) (v0.4.1) #572

Open
jpmorgan98 opened this issue Oct 16, 2024 · 1 comment · May be fixed by #574
Open

Unit test failure (test_version) (v0.4.1) #572

jpmorgan98 opened this issue Oct 16, 2024 · 1 comment · May be fixed by #574
Assignees
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". PyOpenSci / JOSS

Comments

@jpmorgan98
Copy link

Describe the bug

Failed TestVersion.test_version when running comprehensive test suite.

To Reproduce

cd MontePy
pytest

Error Message (if any)

================================================== FAILURES ==================================================
__________________________________________ TestVersion.test_version __________________________________________

self = <tests.test_version.TestVersion testMethod=test_version>

    def test_version(self):
        print(os.path.join("montepy", "_version.py"))
>       self.assertTrue(os.path.exists(os.path.join("montepy", "_version.py")))
E       AssertionError: False is not true

tests/test_version.py:10: AssertionError
-------------------------------------------- Captured stdout call --------------------------------------------
montepy/_version.py
========================================== short test summary info ===========================================
FAILED tests/test_version.py::TestVersion::test_version - AssertionError: False is not true

Version

  • Version 0.4.1 with optional testing dependencies (pip install 'montepy[test]')
  • Python 3.12.3

Additional context

Part of pyOpenSci review!

@jpmorgan98 jpmorgan98 added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Oct 16, 2024
@MicahGale
Copy link
Collaborator

Currently the version string is generated by setuptools_scm on deploy by writing montepy/_version.py. This inherently means that _version.py can't be tracked and isn't cloned. Due to this montepy/__init__.py has three ways to determine the version. This test is trying to verify all three methods work. It assumes that _version.py is there. The weird thing is that in CI I can't see where this file is coming from, and it shouldn't be passing?

This test just needs to be updated to ensure that setuptools_scm generates that file.

A temporary workaround would be to run python -m build .

@MicahGale MicahGale self-assigned this Oct 16, 2024
@MicahGale MicahGale linked a pull request Oct 16, 2024 that will close this issue
2 tasks
@MicahGale MicahGale linked a pull request Oct 16, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". PyOpenSci / JOSS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants