freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Integrating Docwriter into FreeType


From: Nikhil Ramakrishnan
Subject: Re: [ft-devel] Integrating Docwriter into FreeType
Date: Mon, 30 Jul 2018 03:32:43 +0530


This is a bit tricky in Python, see https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure.

Basically, tox and therefore pytest is run from the project root directory, which happens to have the docwriter module-directory. Python by default has the current directory in the import path. pytest will collect the tests and run them — when they import docwriter, they will actually import the module-directory in the project root! You however want to test the package as installed by tox somewhere in .tox/…. Stepping out of the root directory, e.g. into the tests directory ensures this.

Well, if I cd into tests/ (with changedir), I'm getting a bunch of import errors. This is because now the tests don't know where 'docwriter' is (outer directory). I'm confused, please advise.


--
Nikhil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]