From Hendrik, 2 Months ago, written in Plain Text.
Embed
  1. Testing started at 12:06 ...
  2. C:\Users\kohrsh\AppData\Local\Continuum\anaconda3\envs\pyside\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\pycharm\_jb_pytest_runner.py" --target test_pandas_model.py::test_view
  3. Launching pytest with arguments test_pandas_model.py::test_view in C:\Users\kohrsh\PycharmProjects\gui
  4. ============================= test session starts =============================
  5. platform win32 -- Python 3.8.2, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
  6. PySide2 5.13.2 -- Qt runtime 5.12.5 -- Qt compiled 5.12.5
  7. rootdir: C:\Users\kohrsh\PycharmProjects\gui
  8. plugins: qt-3.3.0collected 1 item
  9.  
  10. test_pandas_model.py Fmodeltest: Using Python tester
  11. modeltest: Checking children of <invalid> (0x3e91fc0) with depth 0 (10 rows, 1 columns)
  12. modeltest: Children check for <invalid> (0x3e91fc0) done
  13.  
  14. test_pandas_model.py:31 (test_view)
  15. qtbot = <pytestqt.qtbot.QtBot object at 0x0000000003EA40A0>
  16. df_view = <PySide2.QtWidgets.QTableView(0x45f8590) at 0x0000000006BB8280>
  17. df_model = <pandas_model.DataFrameModel(0x4568860) at 0x0000000006BB8180>
  18. qtmodeltester = <pytestqt.modeltest.ModelTester object at 0x0000000003EA4460>
  19.  
  20.     def test_view(qtbot, df_view, df_model, qtmodeltester):
  21.         qtmodeltester.check(df_model)
  22.         index = df_model.index(2, 0)
  23.         df_view.selectionModel().setCurrentIndex(index, QtCore.QItemSelectionModel.Current)
  24. >       qtbot.stop()
  25.  
  26. test_pandas_model.py:36:
  27. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  28.  
  29. self = <pytestqt.qtbot.QtBot object at 0x0000000003EA40A0>
  30.  
  31.     def stopForInteraction(self):
  32.         """
  33.         Stops the current test flow, letting the user interact with any visible widget.
  34.    
  35.         This is mainly useful so that you can verify the current state of the program while writing
  36.         tests.
  37.    
  38.         Closing the windows should resume the test run, with ``qtbot`` attempting to restore visibility
  39.         of the widgets as they were before this call.
  40.    
  41.         .. note:: As a convenience, it is also aliased as `stop`.
  42.         """
  43.         widget_and_visibility = []
  44.         for weak_widget in _iter_widgets(self._request.node):
  45.             widget = weak_widget()
  46.             if widget is not None:
  47. >               widget_and_visibility.append((widget, widget.isVisible()))
  48. E               AttributeError: 'DataFrameModel' object has no attribute 'isVisible'
  49.  
  50. ..\..\AppData\Local\Continuum\anaconda3\envs\pyside\lib\site-packages\pytestqt\qtbot.py:273: AttributeError
  51. E
  52. test_pandas_model.py:31 (test_view)
  53. item = <Function test_view>
  54.  
  55.     @pytest.mark.hookwrapper
  56.     @pytest.mark.trylast
  57.     def pytest_runtest_teardown(item):
  58.         """
  59.         Hook called after each test tear down, to process any pending events and
  60.         avoiding leaking events to the next test. Also, if exceptions have
  61.         been captured during fixtures teardown, fail the test.
  62.         """
  63.         _process_events()
  64. >       _close_widgets(item)
  65.  
  66. ..\..\AppData\Local\Continuum\anaconda3\envs\pyside\lib\site-packages\pytestqt\plugin.py:181:
  67. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  68.  
  69. item = <Function test_view>
  70.  
  71.     def _close_widgets(item):
  72.         """
  73.         Close all widgets registered in the pytest item.
  74.         """
  75.         widgets = getattr(item, "qt_widgets", None)
  76.         if widgets:
  77.             for w, before_close_func in item.qt_widgets:
  78.                 w = w()
  79.                 if w is not None:
  80.                     if before_close_func is not None:
  81.                         before_close_func(w)
  82. >                   w.close()
  83. E                   AttributeError: 'DataFrameModel' object has no attribute 'close'
  84.  
  85. ..\..\AppData\Local\Continuum\anaconda3\envs\pyside\lib\site-packages\pytestqt\qtbot.py:682: AttributeError
  86.                                                   [100%]
  87.  
  88. =================================== ERRORS ====================================
  89. _______________________ ERROR at teardown of test_view ________________________
  90.  
  91. item = <Function test_view>
  92.  
  93.     @pytest.mark.hookwrapper
  94.     @pytest.mark.trylast
  95.     def pytest_runtest_teardown(item):
  96.         """
  97.         Hook called after each test tear down, to process any pending events and
  98.         avoiding leaking events to the next test. Also, if exceptions have
  99.         been captured during fixtures teardown, fail the test.
  100.         """
  101.         _process_events()
  102. >       _close_widgets(item)
  103.  
  104. ..\..\AppData\Local\Continuum\anaconda3\envs\pyside\lib\site-packages\pytestqt\plugin.py:181:
  105. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  106.  
  107. item = <Function test_view>
  108.  
  109.     def _close_widgets(item):
  110.         """
  111.         Close all widgets registered in the pytest item.
  112.         """
  113.         widgets = getattr(item, "qt_widgets", None)
  114.         if widgets:
  115.             for w, before_close_func in item.qt_widgets:
  116.                 w = w()
  117.                 if w is not None:
  118.                     if before_close_func is not None:
  119.                         before_close_func(w)
  120. >                   w.close()
  121. E                   AttributeError: 'DataFrameModel' object has no attribute 'close'
  122.  
  123. ..\..\AppData\Local\Continuum\anaconda3\envs\pyside\lib\site-packages\pytestqt\qtbot.py:682: AttributeError
  124. ---------------------------- Captured stdout call -----------------------------
  125. modeltest: Using Python tester
  126. modeltest: Checking children of <invalid> (0x3e91fc0) with depth 0 (10 rows, 1 columns)
  127. modeltest: Children check for <invalid> (0x3e91fc0) done
  128. ================================== FAILURES ===================================
  129. __________________________________ test_view __________________________________
  130.  
  131. qtbot = <pytestqt.qtbot.QtBot object at 0x0000000003EA40A0>
  132. df_view = <PySide2.QtWidgets.QTableView(0x45f8590) at 0x0000000006BB8280>
  133. df_model = <pandas_model.DataFrameModel(0x4568860) at 0x0000000006BB8180>
  134. qtmodeltester = <pytestqt.modeltest.ModelTester object at 0x0000000003EA4460>
  135.  
  136.     def test_view(qtbot, df_view, df_model, qtmodeltester):
  137.         qtmodeltester.check(df_model)
  138.         index = df_model.index(2, 0)
  139.         df_view.selectionModel().setCurrentIndex(index, QtCore.QItemSelectionModel.Current)
  140. >       qtbot.stop()
  141.  
  142. test_pandas_model.py:36:
  143. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  144.  
  145. self = <pytestqt.qtbot.QtBot object at 0x0000000003EA40A0>
  146.  
  147.     def stopForInteraction(self):
  148.         """
  149.         Stops the current test flow, letting the user interact with any visible widget.
  150.    
  151.         This is mainly useful so that you can verify the current state of the program while writing
  152.         tests.
  153.    
  154.         Closing the windows should resume the test run, with ``qtbot`` attempting to restore visibility
  155.         of the widgets as they were before this call.
  156.    
  157.         .. note:: As a convenience, it is also aliased as `stop`.
  158.         """
  159.         widget_and_visibility = []
  160.         for weak_widget in _iter_widgets(self._request.node):
  161.             widget = weak_widget()
  162.             if widget is not None:
  163. >               widget_and_visibility.append((widget, widget.isVisible()))
  164. E               AttributeError: 'DataFrameModel' object has no attribute 'isVisible'
  165.  
  166. ..\..\AppData\Local\Continuum\anaconda3\envs\pyside\lib\site-packages\pytestqt\qtbot.py:273: AttributeError
  167. ---------------------------- Captured stdout call -----------------------------
  168. modeltest: Using Python tester
  169. modeltest: Checking children of <invalid> (0x3e91fc0) with depth 0 (10 rows, 1 columns)
  170. modeltest: Children check for <invalid> (0x3e91fc0) done
  171. =========================== short test summary info ===========================
  172. FAILED test_pandas_model.py::test_view - AttributeError: 'DataFrameModel' obj...
  173. ERROR test_pandas_model.py::test_view - AttributeError: 'DataFrameModel' obje...
  174. ========================= 1 failed, 1 error in 2.15s ==========================
  175.  
  176. Process finished with exit code 0
  177.  
  178. Assertion failed
  179.  
  180. Assertion failed
  181.