1. 08 Oct, 2021 1 commit
  2. 13 Aug, 2021 1 commit
    • Aaron Gokaslan's avatar
      maint(precommit): Apply isort (#3195) · 9df2f1ff
      Aaron Gokaslan authored
      * Apply isort
      
      * Tweak isort config
      
      * Add env.py as a known_first_party
      
      * Add one missing known first party
      
      * Make config compat with older isort versions
      
      * Add another comment
      
      * Revert pyproject setting
      9df2f1ff
  3. 30 Jun, 2021 1 commit
    • Ralf W. Grosse-Kunstleve's avatar
      pickle setstate: setattr __dict__ only if not empty (#2972) · fbae8f31
      Ralf W. Grosse-Kunstleve authored
      * pickle setstate: setattr __dict__ only if not empty, to not force use of py::dynamic_attr() unnecessarily.
      
      * Adding unit test.
      
      * Clang 3.6 & 3.7 compatibility.
      
      * PyPy compatibility.
      
      * Minor iwyu fix, additional comment.
      
      * Addressing reviewer requests.
      
      * Applying clang-tidy suggested fixes.
      
      * Adding check_dynamic_cast_SimpleCppDerived, related to issue #3062.
      fbae8f31
  4. 16 Oct, 2020 1 commit
  5. 16 Aug, 2020 1 commit
    • Henry Schreiner's avatar
      tests: cleanup and ci hardening (#2397) · 4d9024ec
      Henry Schreiner authored
      * tests: refactor and cleanup
      
      * refactor: more consistent
      
      * tests: vendor six
      
      * tests: more xfails, nicer system
      
      * tests: simplify to info
      
      * tests: suggestions from @YannickJadoul and @bstaletic
      
      * tests: restore some pypy tests that now pass
      
      * tests: rename info to env
      
      * tests: strict False/True
      
      * tests: drop explicit strict=True again
      
      * tests: reduce minimum PyTest to 3.1
      4d9024ec
  6. 20 Jul, 2020 1 commit
  7. 11 Sep, 2018 1 commit
    • Wenzel Jakob's avatar
      enum_: move most functionality to a non-template implementation · f4245181
      Wenzel Jakob authored
      This commit addresses an inefficiency in how enums are created in
      pybind11. Most of the enum_<> implementation is completely generic --
      however, being a template class, it ended up instantiating vast amounts
      of essentially identical code in larger projects with many enums.
      
      This commit introduces a generic non-templated helper class that is
      compatible with any kind of enumeration. enum_ then becomes a thin
      wrapper around this new class.
      
      The new enum_<> API is designed to be 100% compatible with the old one.
      f4245181
  8. 30 Aug, 2017 1 commit
  9. 05 Aug, 2017 1 commit
    • Jason Rhinelander's avatar
      Update all remaining tests to new test styles · 391c7544
      Jason Rhinelander authored
      This udpates all the remaining tests to the new test suite code and
      comment styles started in #898.  For the most part, the test coverage
      here is unchanged, with a few minor exceptions as noted below.
      
      - test_constants_and_functions: this adds more overload tests with
        overloads with different number of arguments for more comprehensive
        overload_cast testing.  The test style conversion broke the overload
        tests under MSVC 2015, prompting the additional tests while looking
        for a workaround.
      
      - test_eigen: this dropped the unused functions `get_cm_corners` and
        `get_cm_corners_const`--these same tests were duplicates of the same
        things provided (and used) via ReturnTester methods.
      
      - test_opaque_types: this test had a hidden dependence on ExampleMandA
        which is now fixed by using the global UserType which suffices for the
        relevant test.
      
      - test_methods_and_attributes: this required some additions to UserType
        to make it usable as a replacement for the test's previous SimpleType:
        UserType gained a value mutator, and the `value` property is not
        mutable (it was previously readonly).  Some overload tests were also
        added to better test overload_cast (as described above).
      
      - test_numpy_array: removed the untemplated mutate_data/mutate_data_t:
        the templated versions with an empty parameter pack expand to the same
        thing.
      
      - test_stl: this was already mostly in the new style; this just tweaks
        things a bit, localizing a class, and adding some missing
        `// test_whatever` comments.
      
      - test_virtual_functions: like `test_stl`, this was mostly in the new
        test style already, but needed some `// test_whatever` comments.
        This commit also moves the inherited virtual example code to the end
        of the file, after the main set of tests (since it is less important
        than the other tests, and rather length); it also got renamed to
        `test_inherited_virtuals` (from `test_inheriting_repeat`) because it
        tests both inherited virtual approaches, not just the repeat approach.
      391c7544
  10. 16 Dec, 2016 1 commit
    • Wenzel Jakob's avatar
      WIP: PyPy support (#527) · 1d1f81b2
      Wenzel Jakob authored
      This commit includes modifications that are needed to get pybind11 to work with PyPy. The full test suite compiles and runs except for a last few functions that are commented out (due to problems in PyPy that were reported on the PyPy bugtracker).
      
      Two somewhat intrusive changes were needed to make it possible: two new tags ``py::buffer_protocol()`` and ``py::metaclass()`` must now be specified to the ``class_`` constructor if the class uses the buffer protocol and/or requires a metaclass (e.g. for static properties).
      
      Note that this is only for the PyPy version based on Python 2.7 for now. When the PyPy 3.x has caught up in terms of cpyext compliance, a PyPy 3.x patch will follow.
      1d1f81b2
  11. 11 Oct, 2016 1 commit
  12. 19 Aug, 2016 1 commit
    • Dean Moldovan's avatar
      Port tests to pytest · a0c1ccf0
      Dean Moldovan authored
      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.
      a0c1ccf0