I have a file abc.py
under the workspace dir.
I am using os.listdir('/home/workspace/tests')
in abc.py
to list all the files (test1.py
, test2.py
...)
I want to generate the path '/home/workspace/tests'
or even '/home/workspace'
instead of hardcoding it.
I tried os.getcwd()
and os.path.dirname(os.path.abspath(____file____))
but this instead generates the path where the test script is being run.
How to go about it?