-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add conftest to build messages and set path prior to collection/running tests * clean up tests * update README for testing changes * edits * some fixes and version bump * only write generated cython code if it differs from what's there (to avoid unnecessary compilation) * add clean argument to compiler to force recompilation of messages
- Loading branch information
1 parent
c8b9636
commit 17bb488
Showing
25 changed files
with
102 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import sys | ||
|
||
from distutils.util import get_platform | ||
from pyrobuf.compile import Compiler | ||
|
||
|
||
def pytest_sessionstart(session): | ||
# Build test messages from proto specs | ||
here = os.path.dirname(os.path.abspath(__file__)) | ||
proto = [os.path.join(here, 'proto', filename) | ||
for filename in os.listdir(os.path.join(here, 'proto'))] | ||
compiler = Compiler(proto, out='tests/out', build='tests/build') | ||
compiler.compile() | ||
|
||
# Add test directory into path | ||
if here not in sys.path: | ||
sys.path.append(here) | ||
|
||
# Insert built messages into path | ||
build = os.path.join(here, 'build') | ||
lib_path = os.path.join(build, "lib.{0}-{1}".format(get_platform(), | ||
sys.version[0:3])) | ||
|
||
if lib_path not in sys.path: | ||
sys.path.insert(0, lib_path) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.