Problem with python tests and DataContext

When trying to run the python tests (as described in the manual installation):

python -m test

with the SRC_DIR is configured to the directory containing pyhelpers.py.
The following error appears for any tests with setup_orekit_curdir():

_________________________ ERROR collecting AEMTest.py __________________________
AEMTest.py:31: in <module>
    setup_orekit_curdir()
../../RuggedVenv/lib/python3.6/site-packages/orekit-10.3-py3.6-linux-x86_64.egg/orekit/pyhelpers.py:78: in setup_orekit_curdir
    DM = DataContext.getDefault().getDataProvidersManager()
E   NameError: name 'DataContext' is not defined

I tried to put pyhelpers.py in the same directory as the tests but it does not solve the problem.

The orekit-data.zip file is in the same directory as the tests.

Any idea ?

Sorry that manual instruction is quite old and likely outdatedā€¦ I think there may be an error in the pyhelpers.py file that has not been updated in that repository, please use the one from GitHub - petrushy/orekit_python_artifacts at version-10.3.1

The tests there are the latest as well.

Let us know how it goes

Now the pyhelper.py and test files should be the latest ones on the gitlab repo also.

Thanks Petrus for the new pyhelpers.py and the new tests, everything runs fine:
38 passed, 2115 warnings

I suppose the warnings are normal, for instance:

../../../../../../../usr/lib/python3.6/importlib/_bootstrap.py:219
  /usr/lib/python3.6/importlib/_bootstrap.py:219: DeprecationWarning: builtin type LagrangianPoints has no __module__ attribute
    return f(*args, **kwds)

I copied the test/ directory from https://github.com/petrushy/orekit_python_artifacts/tree/version-10.3, without copying the resources/ directory at first. So some tests failed because of the missing resources/ directory. Once copied the resources/ directory everything runs fine.

I noticed that in https://gitlab.orekit.org/orekit-labs/python-wrapper/-/tree/master/python_files/test, there is no resources/ directory but a resources.zip file. When trying to launch: python -m pytest, some tests failed due to the missing directory, for instance:

org.orekit.errors.OrekitException: unable to find file ./resources/ccsds/AEMExample.txt