[PATCH] Start conversion tests to using pytest.
Amar Takhar
amar at rtems.org
Mon Mar 16 04:11:46 UTC 2020
On 2020-03-15 21:28 -0600, Gedare Bloom wrote:
> > +# Always find the parent directory of rtemstoolkit/ no matter where
> > +# pytest is run.
> > +def pytest_runtest_setup(item):
> > + path_toolkit = os.path.dirname(os.path.abspath(__file__))
> > + path.append(path_toolkit[0:path_toolkit.rfind('/')])
> Does this work right on Windows? (Excuse my ignorance, but I'm not
> sure what is cross-platform and what is not in Python, and I get
> jittery when I see hard-coded slashes in paths.)
Actually, that's a great catch and this has already been fixed I forgot to push
my changes from my windows machine I took this patch before that. I need to be
more diligent as I'm testing this on Windows, Linux, OS X and FreeBSD.
The platform-agnostic version uses os.dirname() on the path to do this which is
Python 2.7+ friendly. The 2nd line is:
path.append(os.path.dirname(path_toolkit))
Amar.
More information about the devel
mailing list