I have to read and write to files which are located in sympy/parsing/tests/test_examples in my test file test_autolev.py.
This is the kind of code I am using in test_autolev.py directory = "sympy/parsing/tests/test_examples/" parse_autolev(os.path.join(*(directory+inFileName).split('/')), os.path.join(*(directory+"output.py").split('/'))) correctFile = open(os.path.join(*(directory+outFileName).split('/')), 'r') outputFile = open(os.path.join(*(directory+"output.py").split('/')), 'r')` This is passing on my PC when I run bin/test parsing but it is causing Travis errors of this sort: File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/sympy-1.1.2.dev0-py2.7.egg/sympy/utilities/runtests.py", line 1274, in _timeout function() File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/sympy-1.1.2.dev0-py2.7.egg/sympy/parsing/tests/test_autolev.py", line 39, in test_example1 _test_examples("test1_in.txt", "expected_output1.txt") File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/sympy-1.1.2.dev0-py2.7.egg/sympy/parsing/tests/test_autolev.py", line 12, in _test_examples correctFile = open(os.path.join(*(directory+outFileName).split('/')), 'r') IOError: [Errno 2] No such file or directory: 'sympy/parsing/tests/test_examples/expected_output1.txt' How can I fix this? How can I access specific files in the SymPy directories? Will using something like os.path.abspath() or os.getcwd() work? Also, tests seem to be run using utilities/runtests.py in Travis while I use bin/test on my PC. Would that make any difference? What would be the best way to do this type of thing? -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/8fe0f4fd-27ff-409c-bff6-1acc2bfd8229%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.