Commit Graph

564 Commits

Author SHA1 Message Date
Jason Rhinelander
540ae61d3c Replace tabs with spaces (to pass style check) 2016-08-28 14:11:38 -04:00
Jason Rhinelander
dd3d56a885 Don't install pytest from cmake, just fail instead
Installing something outside the project directory from a cmake
invocation is overly intrusive; this changes tests/CMakeLists.txt to
just fail with an informative message instead, and changes the
travis-ci builds to install pytest via pip or apt-get.
2016-08-26 17:22:48 -04:00
Dean Moldovan
23919174a7 Fix test suite failure without numpy and improve module init diagnostics
Fixes #357.
2016-08-25 17:08:09 +02:00
Wenzel Jakob
69b6246677 add reason attribute to pytest.mark.skipif 2016-08-25 02:20:35 +02:00
Wenzel Jakob
89f2db4596 Merge pull request #353 from aldanor/feature/generalized-iterators
Add support for iterators with different begin/end types
2016-08-25 01:47:38 +02:00
Wenzel Jakob
1ffce7422d Get pybind11 test suite to compile on the Intel compiler (more or less..)
- ICPC can't handle the NCVirt trampoline which returns a non-copyable
  type, which is likely due to a constexpr/SFINAE issue. This disables
  the test on that compiler so that at least the rest can be tested.
2016-08-25 01:43:35 +02:00
Ivan Smirnov
4c5e21b0cb Add tests for generalized iterators 2016-08-24 23:30:00 +01:00
Dean Moldovan
99dbdc16e5 Simplify more tests by replacing capture with assert 2016-08-19 16:31:48 +02:00
Dean Moldovan
3b44daedf6 Rewrite eval tests to allow for simple asserts
Most of the test code is left in C++ since this is the
intended use case for the eval functions.
2016-08-19 16:31:48 +02:00
Dean Moldovan
18319d5598 Automatically install pytest from CMake
Pytest is a development dependency but we can make it painless by
automating the install using CMake.
2016-08-19 13:32:01 +02:00
Dean Moldovan
a9a37b4e31 Move enum tests into a new file
There are more enum tests than 'constants and functions'.
2016-08-19 13:19:38 +02:00
Dean Moldovan
382db5b2e7 Move inheritance tests into the proper file 2016-08-19 13:19:38 +02:00
Dean Moldovan
665e8804f3 Simplify tests by replacing output capture with asserts where possible
The C++ part of the test code is modified to achieve this. As a result,
this kind of test:

```python
with capture:
    kw_func1(5, y=10)
assert capture == "kw_func(x=5, y=10)"
```

can be replaced with a simple:

`assert kw_func1(5, y=10) == "x=5, y=10"`
2016-08-19 13:19:38 +02:00
Dean Moldovan
a0c1ccf0a9 Port tests to pytest
Use simple asserts and pytest's powerful introspection to make testing
simpler. This merges the old .py/.ref file pairs into simple .py files
where the expected values are right next to the code being tested.

This commit does not touch the C++ part of the code and replicates the
Python tests exactly like the old .ref-file-based approach.
2016-08-19 13:19:38 +02:00