Closed mattip closed 1 year ago
Hello, first I want to say that Pony tests are unittest
not pytest
.
And you run them as
cd pony/orm
python -m unittest discover
ahh, cool. That gives a much more reasonable output
3 errors due to
pony.orm.decompiling.DecompileError: Unsupported operation: CALL_METHOD_KW
and two due to
_sqlite3.OperationalError: database table is locked
Overall, the test suite runs in ~50 secs (with the latest PyPy3.8) where CPython3.8 runs the suite successfully in ~18 secs. In general, we see about a 2x slowdown when running test suites with PyPy, since the short snippets do not give the JIT time to warm up and the base interpreter is slower. Here we are more than 3x.
Closing, thanks for the pointer about unittest.
I am a PyPy developer, and someone suggested we check PyPy + pony to see if our AST is compatible. I tried to run the tests and get an error
fixture 'test_case' not found
. Any hints what I am doing wrong?full test output
``` ========================================================== test session starts ========================================================== platform linux -- Python 3.8.16[pypy-7.3.12-alpha], pytest-7.2.0, pluggy-1.0.0 rootdir: /home/mattip/oss/pony collected 3917 items pony/orm/tests/test_array.py E........................................ [ 1%] pony/orm/tests/test_attribute_options.py ................. [ 1%] pony/orm/tests/test_autostrip.py .. [ 1%] pony/orm/tests/test_buffer.py ... [ 1%] pony/orm/tests/test_bug_170.py . [ 1%] pony/orm/tests/test_bug_182.py . [ 1%] pony/orm/tests/test_bug_331.py . [ 1%] pony/orm/tests/test_bug_386.py . [ 1%] pony/orm/tests/test_cascade.py E...... [ 1%] pony/orm/tests/test_cascade_delete.py .. [ 1%] pony/orm/tests/test_collections.py ......... [ 2%] pony/orm/tests/test_conversions.py .... [ 2%] pony/orm/tests/test_core_find_in_cache.py ............... [ 2%] pony/orm/tests/test_core_multiset.py ............ [ 2%] pony/orm/tests/test_crud.py E..................... [ 3%] pony/orm/tests/test_crud_raw_sql.py ....... [ 3%] pony/orm/tests/test_datetime.py E...................... [ 4%] pony/orm/tests/test_db_session.py E................................................. [ 5%] pony/orm/tests/test_declarative_attr_set_monad.py E...................................... [ 6%] pony/orm/tests/test_declarative_exceptions.py E...................................................... [ 7%] pony/orm/tests/test_declarative_func_monad.py E................... [ 8%] pony/orm/tests/test_declarative_join_optimization.py E..... [ 8%] pony/orm/tests/test_declarative_object_flat_monad.py .. [ 8%] pony/orm/tests/test_declarative_orderby_limit.py E...................... [ 9%] pony/orm/tests/test_declarative_query_set_monad.py E......F......F.........................................................F [ 11%] pony/orm/tests/test_declarative_sqltranslator.py E............................................................................... [ 13%] ................. [ 13%] pony/orm/tests/test_declarative_sqltranslator2.py E................................... [ 14%] pony/orm/tests/test_declarative_strings.py E...................................................... [ 15%] pony/orm/tests/test_decompiler.py ............................................................................................... [ 18%] ................................................................................................................................. [ 21%] ................................................................................................................................. [ 24%] ................................................................................................................................. [ 28%] ................................................................................................................................. [ 31%] ................................................................................................................................. [ 34%] ................................................................................................................................. [ 38%] ................................................................................................................................. [ 41%] ................................................................................................................................. [ 44%] ................................................................................................................................. [ 47%] ................................................................................................................................. [ 51%] ................................................................................................................................. [ 54%] ................................................................................................................................. [ 57%] ................................................................................................................................. [ 61%] ................................................................................................................................. [ 64%] ................................................................................................................................. [ 67%] ................................................................................................................................. [ 71%] ................................................................................................................................. [ 74%] ................................................................................................................................. [ 77%] ................................................................................................................................. [ 80%] ..............E [ 81%] pony/orm/tests/test_deduplication.py ... [ 81%] pony/orm/tests/test_diagram.py E.............. [ 81%] pony/orm/tests/test_diagram_attribute.py E.................................................................... [ 83%] pony/orm/tests/test_diagram_keys.py E.................... [ 84%] pony/orm/tests/test_distinct.py E..... [ 84%] pony/orm/tests/test_entity_init.py . [ 84%] pony/orm/tests/test_entity_proxy.py E......... [ 84%] pony/orm/tests/test_exists.py E....... [ 84%] pony/orm/tests/test_f_strings.py E.......... [ 84%] pony/orm/tests/test_filter.py ........ [ 85%] pony/orm/tests/test_flush.py E. [ 85%] pony/orm/tests/test_frames.py E.......................... [ 85%] pony/orm/tests/test_generator_db_session.py E............ [ 86%] pony/orm/tests/test_get_pk.py ... [ 86%] pony/orm/tests/test_getattr.py .......... [ 86%] pony/orm/tests/test_hooks.py ...... [ 86%] pony/orm/tests/test_hybrid_methods_and_properties.py E................................... [ 87%] pony/orm/tests/test_indexes.py E..... [ 87%] pony/orm/tests/test_inheritance.py E...................... [ 88%] pony/orm/tests/test_inner_join_syntax.py .... [ 88%] pony/orm/tests/test_int_converter.py E.... [ 88%] pony/orm/tests/test_interleave.py sssss [ 88%] pony/orm/tests/test_isinstance.py E......... [ 89%] pony/orm/tests/test_json.py ........................................................................ [ 90%] pony/orm/tests/test_lambda.py ..... [ 90%] pony/orm/tests/test_lazy.py ..... [ 91%] pony/orm/tests/test_list_monad.py E........ [ 91%] pony/orm/tests/test_mapping.py E..................... [ 91%] pony/orm/tests/test_objects_to_save_cleanup.py ...... [ 92%] pony/orm/tests/test_prefetching.py E................... [ 92%] pony/orm/tests/test_prop_sum_orderby.py E.............. [ 92%] pony/orm/tests/test_query.py E....................................... [ 93%] pony/orm/tests/test_random.py E.. [ 94%] pony/orm/tests/test_raw_sql.py ..................... [ 94%] pony/orm/tests/test_relations_m2m.py ................. [ 95%] pony/orm/tests/test_relations_one2many.py E................... [ 95%] pony/orm/tests/test_relations_one2one1.py .............. [ 95%] pony/orm/tests/test_relations_one2one2.py E.......... [ 96%] pony/orm/tests/test_relations_one2one3.py E....... [ 96%] pony/orm/tests/test_relations_one2one4.py E. [ 96%] pony/orm/tests/test_relations_symmetric_m2m.py ......... [ 96%] pony/orm/tests/test_relations_symmetric_one2one.py ...... [ 96%] pony/orm/tests/test_seeds.py E. [ 96%] pony/orm/tests/test_select_from_select_queries.py E............................................. [ 98%] pony/orm/tests/test_show.py E.. [ 98%] pony/orm/tests/test_sqlbuilding_formatstyles.py ..... [ 98%] pony/orm/tests/test_sqlbuilding_sqlast.py FF [ 98%] pony/orm/tests/test_sqlite_shared_memory_db.py . [ 98%] pony/orm/tests/test_sqlite_str_functions.py E....... [ 98%] pony/orm/tests/test_time_parsing.py .............. [ 98%] pony/orm/tests/test_to_dict.py E......................... [ 99%] pony/orm/tests/test_tracked_value.py .... [ 99%] pony/orm/tests/test_transaction_lock.py ... [ 99%] pony/orm/tests/test_validate.py .... [ 99%] pony/orm/tests/test_volatile.py E...... [100%] ================================================================ ERRORS ================================================================= _________________________________________________ ERROR at setup of test_exception_msg __________________________________________________ file /home/mattip/oss/pony/pony/orm/tests/testutils.py, line 9 def test_exception_msg(test_case, exc_msg, test_msg=None): E fixture 'test_case' not found > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory > use 'pytest --fixtures [testpath]' for help on them. /home/mattip/oss/pony/pony/orm/tests/testutils.py:9 _________________________________________________ ERROR at setup of test_exception_msg __________________________________________________ file /home/mattip/oss/pony/pony/orm/tests/testutils.py, line 9 def test_exception_msg(test_case, exc_msg, test_msg=None): E fixture 'test_case' not found > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory > use 'pytest --fixtures [testpath]' for help on them. ... =============================================================== FAILURES ================================================================ _____________________________________________________ TestQuerySetMonad.test_avg_5 ______________________________________________________ self =short test output:
lots of warnings like
lots of collection errors like
some errors around teardown of databases that are locked (probably due to
close
not being called explicitly for PyPysome errors about missing opcode, these are the ones I was looking for. They all look like