[sssd PR#5651][opened] TEST: Use absolute path for the MODPATH assertions in python tests
by mtorromeo
URL: https://github.com/SSSD/sssd/pull/5651
Author: mtorromeo
Title: #5651: TEST: Use absolute path for the MODPATH assertions in python tests
Action: opened
PR body:
"""
Since 2.5.0 I had these 3 tests fail with the following assertion error:
```
======================================================================
FAIL: testImport (__main__.PyHbacImport)
Import the module and assert it comes from tree
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build/sssd/src/sssd-2.5.0/src/tests/pyhbac-test.py", line 91, in testImport
self.assertEqual(pyhbac.__file__, MODPATH + "/pyhbac.so")
AssertionError: '/build/sssd/src/sssd-2.5.0/./tp_pyhbac_za3ox6lp/pyhbac.so' != './tp_pyhbac_za3ox6lp/pyhbac.so'
- /build/sssd/src/sssd-2.5.0/./tp_pyhbac_za3ox6lp/pyhbac.so
+ ./tp_pyhbac_za3ox6lp/pyhbac.so
```
I don't know what changed but the issue here is related to a long-standing bug [1] in `tempfile.mkdtemp` where the returned path is not absolute if the dir parameter is relative, despite the documentation saying that the returned path is always absolute.
[1] https://bugs.python.org/issue7325
"""
To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5651/head:pr5651
git checkout pr5651
2 years, 5 months