Skip to content

Commit

Permalink
somewhat cleaner test run. Now relying on pypi released test depends.
Browse files Browse the repository at this point in the history
  • Loading branch information
asmodehn committed Aug 31, 2017
1 parent 19c0030 commit c44e1fd
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 35 deletions.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# default
include README.rst
include setup.py

# including tests in sdist
recursive-include tests *
6 changes: 3 additions & 3 deletions requirements/indigo/debs_in_venv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ numpy>=1.8.1
-e git+https://github.com/asmodehn/genmsg.git@setuptools#egg=ros_genmsg
-e git+https://github.com/asmodehn/genpy.git@setuptools#egg=ros_genpy

# source access to latest filefinder and rosimport from git ...
-e git+https://github.com/asmodehn/filefinder2.git#egg=filefinder2
-e git+https://github.com/asmodehn/rosimport.git#egg=rosimport
# These dependencies are python pkgs only and only for tests.
filefinder2
rosimport

6 changes: 3 additions & 3 deletions requirements/kinetic/debs_in_venv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ numpy==1.11.0
-e git+https://github.com/asmodehn/genmsg.git@setuptools#egg=ros_genmsg
-e git+https://github.com/asmodehn/genpy.git@setuptools-kinetic#egg=ros_genpy

# source access to latest filefinder and rosimport from git ...
-e git+https://github.com/asmodehn/filefinder2.git#egg=filefinder2
-e git+https://github.com/asmodehn/rosimport.git#egg=rosimport
# These dependencies are python pkgs only and only for tests.
filefinder2
rosimport

6 changes: 3 additions & 3 deletions requirements/lunar/debs_in_venv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ numpy==1.11.0
-e git+https://github.com/asmodehn/genmsg.git@setuptools#egg=ros_genmsg
-e git+https://github.com/asmodehn/genpy.git@setuptools-kinetic#egg=ros_genpy

# source access to latest filefinder and rosimport from git ...
-e git+https://github.com/asmodehn/filefinder2.git#egg=filefinder2
-e git+https://github.com/asmodehn/rosimport.git#egg=rosimport
# These dependencies are python pkgs only and only for tests.
filefinder2
rosimport
3 changes: 0 additions & 3 deletions requirements/python/indigo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@
-e git+https://github.com/asmodehn/genmsg.git@setuptools#egg=ros_genmsg
-e git+https://github.com/asmodehn/genpy.git@setuptools#egg=ros_genpy

# source access to latest filefinder and rosimport from git ...
-e git+https://github.com/asmodehn/filefinder2.git#egg=filefinder2
-e git+https://github.com/asmodehn/rosimport.git#egg=rosimport

3 changes: 0 additions & 3 deletions requirements/python/kinetic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@
-e git+https://github.com/asmodehn/genmsg.git@setuptools#egg=ros_genmsg
-e git+https://github.com/asmodehn/genpy.git@setuptools-kinetic#egg=ros_genpy

# source access to latest filefinder and rosimport from git ...
-e git+https://github.com/asmodehn/filefinder2.git#egg=filefinder2
-e git+https://github.com/asmodehn/rosimport.git#egg=rosimport

3 changes: 0 additions & 3 deletions requirements/python/latest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
-e git+https://github.com/asmodehn/genmsg.git@setuptools#egg=ros_genmsg
-e git+https://github.com/asmodehn/genpy.git@setuptools-kinetic#egg=ros_genpy

# source access to latest filefinder and rosimport from git ...
-e git+https://github.com/asmodehn/filefinder2.git#egg=filefinder2
-e git+https://github.com/asmodehn/rosimport.git#egg=rosimport
3 changes: 0 additions & 3 deletions requirements/python/lunar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@
-e git+https://github.com/asmodehn/genmsg.git@setuptools#egg=ros_genmsg
-e git+https://github.com/asmodehn/genpy.git@setuptools-kinetic#egg=ros_genpy

# source access to latest filefinder and rosimport from git ...
-e git+https://github.com/asmodehn/filefinder2.git#egg=filefinder2
-e git+https://github.com/asmodehn/rosimport.git#egg=rosimport
4 changes: 4 additions & 0 deletions requirements/python/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ pytest
pytest-xdist # for --boxed
hypothesis
numpy

# These dependencies are python pkgs only and only for tests.
filefinder2
rosimport
Empty file removed tests/test_pyros_msgs/__init__.py
Empty file.
26 changes: 13 additions & 13 deletions tests/test_pyros_msgs/typecheck/test_ros_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@
# The main point here is insuring that any sanitized type will safely serialize and deserialize
# And also that any type that doesnt safely serialize / deserialize will not pass the type checker

rosmsg_slot_types = [
('bool', st.booleans()),
('int', st.integers()),
('float', st.floats()),
('string', st.binary()),
('time', st.builds(genpy.Time, secs=st.integers(min_value=0), nsecs=st.integers(min_value=0))), # ROS time
('duration', st.builds(genpy.Duration, secs=st.integers(), nsecs=st.integers())), # ROS duration
]

rosmsg_slot_arraytypes = [
(s[0] + '[]', st.lists(elements=s[1]))
for s in rosmsg_slot_types
]
# rosmsg_slot_types = [
# ('bool', st.booleans()),
# ('int', st.integers()),
# ('float', st.floats()),
# ('string', st.binary()),
# ('time', st.builds(genpy.Time, secs=st.integers(min_value=0), nsecs=st.integers(min_value=0))), # ROS time
# ('duration', st.builds(genpy.Duration, secs=st.integers(), nsecs=st.integers())), # ROS duration
# ]
#
# rosmsg_slot_arraytypes = [
# (s[0] + '[]', st.lists(elements=s[1]))
# for s in rosmsg_slot_types
# ]

# TODO : is there a way to generate messages on the fly to test all possible field combinations ?

Expand Down
10 changes: 9 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# tox.ini , put in same dir as setup.py
[tox]

skip_missing_interpreters=True

envlist =

# based on ros distro with ubuntu debs base
Expand Down Expand Up @@ -46,6 +48,10 @@ ROS_DISTRO =

[testenv]

setenv =
# prevent tox to create a bunch of useless bytecode files in tests/
PYTHONDONTWRITEBYTECODE=1

# Dependencies matching the version in each ROS distro
deps =
# TODO : check why / how install_requires are installed or not in tox environments...
Expand All @@ -70,8 +76,10 @@ deps =
# to always force recreation and avoid unexpected side effects
recreate=True

changedir = tests

commands=
# we want to make sure python finds the installed package in tox env
# and doesn't confuse with pyc generated during dev (which happens if we use self test feature here)
py.test --pyargs tests {posargs}
py.test --basetemp={envtmpdir} test_pyros_msgs {posargs}
# Note : -s here might break your terminal...

0 comments on commit c44e1fd

Please sign in to comment.