testsuite for pyglet under Python 3.2

63 views
Skip to first unread message

PKHG

unread,
Jul 15, 2012, 11:03:30 AM7/15/12
to pyglet...@googlegroups.com
Hallo, am on W32 Vista

I used 2to3 on the test directory of pyglet-1.2alpha1
and now trying the test ;-) it starts to run
BUT pyglet.1.log seems to report only errors
The first one is this
ERROR Failure in app.EVENT_LOOP
ERROR Traceback (most recent call last):
  File "tests\..\tests\app\EVENT_LOOP.py", line 54, in test_1_5
    self.t_scheduled(1, 5, 0)
  File "tests\..\tests\app\EVENT_LOOP.py", line 48, in t_scheduled
    pyglet.app.run()
  File "tests\..\pyglet\app\__init__.py", line 123, in run
    event_loop.run()
  File "tests\..\pyglet\app\base.py", line 135, in run
    self._run_estimated()
  File "tests\..\pyglet\app\base.py", line 164, in _run_estimated
    timeout = self.idle()
  File "tests\..\pyglet\app\base.py", line 273, in idle
    redraw_all = self.clock.call_scheduled_functions(dt)
  File "tests\..\pyglet\clock.py", line 309, in call_scheduled_functions
    item.func(ts - item.last_ts, *item.args, **item.kwargs)
  File "tests\..\tests\app\EVENT_LOOP.py", line 37, in f
    self.assertAlmostEqual(dt, interval, places=2)
AssertionError: 1.0073020453716888 != 1 within 2 places

though I think the difference is very small ;-) so I suppose the
assertion commands should be adjusted a bit?

These?
                self.assertAlmostEqual(dt, interval, places=2)
                self.assertAlmostEqual(t - self.last_t, interval, places=2)

and another one:
INFO 8 tests run
INFO Testing graphics.GRAPHICS_ALLOCATION.
INFO Begin unit tests for graphics.GRAPHICS_ALLOCATION
INFO 23 tests run
INFO Testing graphics.IMMEDIATE.
INFO Begin unit tests for graphics.IMMEDIATE
ERROR Failure in graphics.IMMEDIATE
ERROR Traceback (most recent call last):
  File "tests\..\tests\graphics\IMMEDIATE.py", line 42, in test_v2f
    self.generic_test('v2f', v2f_data)
  File "tests\..\tests\graphics\IMMEDIATE.py", line 35, in generic_test
    self.check(v_data, vertices, n_v)
  File "tests\..\tests\graphics\IMMEDIATE.py", line 20, in check
    (e, r))
AssertionError: Feedback array is in error: 0.0, 0.0439453125

but more seriously I get this error stopping all further tests:
Running Test: window.WINDOW_OPEN (9/135)

    Test that a window can be opened.

    Expected behaviour:
        One small window will be opened coloured purple.

        Close the window or press ESC to end the test.

Press return to begin test...
Traceback (most recent call last):
  File "tests\test.py", line 582, in <module>
    main()
  File "tests\test.py", line 576, in main
    component.test(options)
  File "tests\test.py", line 337, in test
    child.test(options)
  File "tests\test.py", line 337, in test
    child.test(options)
  File "tests\test.py", line 337, in test
    child.test(options)
  File "tests\test.py", line 280, in test
    eval(input('Press return to begin test...'))
  File "<string>", line 1

    ^
SyntaxError: unexpected EOF while parsing

Please comment ;-)
       Peter



Andreas Schiefer

unread,
Jul 16, 2012, 3:02:40 AM7/16/12
to pyglet...@googlegroups.com
On Sun, Jul 15, 2012 at 5:03 PM, PKHG <pkhgr...@gmail.com> wrote:
> ERROR Failure in app.EVENT_LOOP
[...]
> AssertionError: 1.0073020453716888 != 1 within 2 places
>
> though I think the difference is very small ;-) so I suppose the
> assertion commands should be adjusted a bit?

I do not see these errors on Win7 64 bit with Python 3.2. But as the
errors seem very small, I think you can ignore them.



> ERROR Failure in graphics.IMMEDIATE
[...]
> AssertionError: Feedback array is in error: 0.0, 0.0439453125

This kind of error is most probably due to the Nvidia driver (which I
guess you are using). There should be even a warning or note about
that in the test output (not in the log file unfortunately). You can
safely ignore these errors.


> Running Test: window.WINDOW_OPEN (9/135)
[...]
> File "tests\test.py", line 280, in test
> eval(input('Press return to begin test...'))
> File "<string>", line 1
>
> ^
> SyntaxError: unexpected EOF while parsing

This one is strange, have you tried running just this single test
(instead of the whole test suite)?
You can start it with: "python tests/test.py window.WINDOW_OPEN"

Also, I do not have a "eval(...)" at line 280 in test.py, where the
error occurs. Was this added during the conversion with 2to3? If so,
which version of 2to3 were you using? I used the one from Python 3.2,
and it does not introduce a call to eval() at this line.


Andy

Peter K.H. Gragert

unread,
Jul 16, 2012, 3:34:54 AM7/16/12
to pyglet...@googlegroups.com
Thanks for looking ;-)

I used python 3.2 's 2to3.py ;-)
in a console eval(input('prompt text')) gives no error

I solved (workaround) it by just put that part after a # ...
and gave a fake result directly ...

Now a lot of tests run but with a lot of failures ;-) ...

=========================================
two examples

ERROR Failure in graphics.RETAINED_INDEXED

ERROR Traceback (most recent call last):
  File "tests\..\tests\graphics\RETAINED_INDEXED.py", line 64, in test_v3f_c4f
    self.generic_test('v3f', v3f_data, 'c4f', c4f_data)
  File "tests\..\tests\graphics\RETAINED_INDEXED.py", line 42, in generic_test
    self.check(get_ordered_data(v_data, n_v), vertices, n_v)
  File "tests\..\tests\graphics\RETAINED_INDEXED.py", line 25, in check
    (e, r))
AssertionError: Feedback array is in error: 0.7279411764705882, 0.24267578125

ERROR Failure in graphics.RETAINED

ERROR Traceback (most recent call last):
  File "tests\..\tests\graphics\RETAINED.py", line 70, in test_v3f_c4f_t4f
    self.generic_test('v3f', v3f_data, 'c4f', c4f_data, 't4f', t4f_data)
  File "tests\..\tests\graphics\RETAINED.py", line 36, in generic_test
    self.check(v_data, vertices, n_v)
  File "tests\..\tests\graphics\RETAINED.py", line 20, in check
    (e, r))

AssertionError: Feedback array is in error: 0.0, 0.0439453125
==================================================

Yes probably my NVIDIA is too old??


2012/7/16 Andreas Schiefer <andreas....@gmail.com>

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To post to this group, send email to pyglet...@googlegroups.com.
To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.


Andreas Schiefer

unread,
Jul 16, 2012, 3:58:06 AM7/16/12
to pyglet...@googlegroups.com
On Mon, Jul 16, 2012 at 9:34 AM, Peter K.H. Gragert
<pkhgr...@gmail.com> wrote:
> I used python 3.2 's 2to3.py ;-)
> in a console eval(input('prompt text')) gives no error
>
> I solved (workaround) it by just put that part after a # ...
> and gave a fake result directly ...

Instead of commenting it out completely, you can just remove the call
to eval(). This is how line 280 of test.py looks in my converted
source:
input('Press return to begin test...')

(still wondering why you have that eval(...) there in the first place)


> Now a lot of tests run but with a lot of failures ;-) ...

> ERROR Failure in graphics.RETAINED_INDEXED
> ERROR Failure in graphics.RETAINED

> Yes probably my NVIDIA is too old??

The errors from the "graphics" group of tests are probably all due to
your driver and can be ignored. Newer drivers do not help either. As I
understand it, the Nvidia drivers make some optimizations that give
wrong results in the tests. But there really is nothing wrong with the
result, we just cannot test it correctly.


Andy

PKHG

unread,
Jul 16, 2012, 4:05:35 AM7/16/12
to pyglet...@googlegroups.com
will try your suggestion (removing eval) ;-)

This then is the first test with errors
INFO Beginning test at Mon Jul 16 10:01:19 2012
INFO Capabilities are: GENERIC, WIN
INFO sys.platform = win32
INFO pyglet.version = 1.2alpha1
INFO Reading test plan from tests\plan.txt
INFO Testing top.IMPORT.
INFO Begin unit tests for top.IMPORT
INFO 27 tests run
INFO Testing window.WINDOW_SET_MOUSE_SYSTEM_CURSOR.
INFO Begin unit tests for window.WINDOW_SET_MOUSE_SYSTEM_CURSOR
ERROR Error in window.WINDOW_SET_MOUSE_SYSTEM_CURSOR

ERROR Traceback (most recent call last):
  File "tests\..\tests\window\WINDOW_SET_MOUSE_SYSTEM_CURSOR.py", line 70, in test_set_visible
    w.close()
  File "tests\..\pyglet\window\win32\__init__.py", line 290, in close
    self.set_mouse_platform_visible(True)
  File "tests\..\pyglet\window\win32\__init__.py", line 389, in set_mouse_platform_visible
    _user32.SetClassLongPtrW(self._view_hwnd, GCL_HCURSOR, cursor)
ctypes.ArgumentError: argument 3: <class 'TypeError'>: wrong type

INFO 1 tests run

others before it form hand about windows work nicely ...


Op zondag 15 juli 2012 17:03:30 UTC+2 schreef PKHG het volgende:

Andreas Schiefer

unread,
Jul 16, 2012, 1:50:04 PM7/16/12
to pyglet...@googlegroups.com
Thanks for your report, this one was actually a bug and is now fixed
in rev. c93c49607d21
> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pyglet-users/-/E_19-70aKT4J.
Reply all
Reply to author
Forward
0 new messages