persistent icon indicating copy to clipboard operation
persistent copied to clipboard

test_docs.py in wheel fails

Open mtelka opened this issue 2 years ago • 5 comments

The test_docs.py included in wheel fails with the following assertion:

AssertionError: could not find my setup.py

Maybe the test should pass (or skip) instead of failure if there is no setup.py available.

mtelka avatar Aug 10 '23 13:08 mtelka

This is the quick and dirty workaround:

--- persistent-5.0/src/persistent/tests/test_docs.py.orig
+++ persistent-5.0/src/persistent/tests/test_docs.py
@@ -36,7 +36,7 @@
         prev, here = here, os.path.dirname(here)
         if here == prev:
             # Let's avoid infinite loops at root
-            raise AssertionError('could not find my setup.py')
+            return unittest.TestSuite()
 
     docs = os.path.join(here, 'docs', 'api')
 

mtelka avatar Aug 10 '23 13:08 mtelka

Marcel Telka wrote at 2023-8-10 06:38 -0700:

This is the quick and dirty workaround:

--- persistent-5.0/src/persistent/tests/test_docs.py.orig
+++ persistent-5.0/src/persistent/tests/test_docs.py
@@ -36,7 +36,7 @@
        prev, here = here, os.path.dirname(here)
        if here == prev:
            # Let's avoid infinite loops at root
-            raise AssertionError('could not find my setup.py')
+            return unittest.TestSuite()

I do not think this is the right solution.

Are you sure you are running the tests correctly?

When I run the tests on master with zope-testrunner --test-path ../persistent/src/ -v, I get

  Ran 771 tests with 0 failures, 0 errors and 6 skipped in 0.399 seconds.
```.
(I am in a sibling folder of `persistent`).

d-maurer avatar Aug 10 '23 15:08 d-maurer

Yes, when the test is run in the git repo (or in sdist) then it pass. I'm talking about wheel. There is no setup.py in the wheel so test_docs.py cannot pass there. Maybe the better solution would be just to exclude test_docs.py from wheel. Or, maybe even better, simply exclude all tests from wheel?

mtelka avatar Aug 10 '23 15:08 mtelka

Marcel Telka wrote at 2023-8-10 08:22 -0700:

Yes, when the test is run in the git repo (or in sdist) then it pass. I'm talking about wheel. There is no setup.py in the wheel so test_docs.py cannot pass there. Maybe the better solution would be just to exclude test_docs.py from wheel. Or, maybe even better, simply exclude all tests from wheel?

You are right!

I think a good solution would be to skrip the test in this case (with the explaining message setup.py unavailable).

Would you like to sign a contributor agreement and provide a pull request?

d-maurer avatar Aug 10 '23 15:08 d-maurer

Would you like to sign a contributor agreement ...

Sorry, no.

mtelka avatar Aug 10 '23 16:08 mtelka