Skip to content

suppress unittest ResourceWarning messages - #556

Merged
dwalton76 merged 3 commits into
ev3dev:ev3dev-stretchfrom
dwalton76:ResourceWarning
Nov 7, 2018
Merged

dwalton76 merged 3 commits into
ev3dev:ev3dev-stretchfrom
dwalton76:ResourceWarning

Conversation

@dwalton76

Copy link
Copy Markdown
Collaborator

For issue #433

This does not fix the issue of the filehandles being left open it just suppresses the warnings generated by unittest. We've had 433 open for almost a year and haven't come up with a good solution and leaving the filehandles open isn't really causing any issues (none that I know of at least). From googling these unittest ResourceWarning messages we would not be the first repo to just ignore these via a warnings filter.

The setUp() method just makes it so you can tell what output is coming from what test (this is optional)

new output

Import warning: Failed to import "evdev". Button will be unusable!


test_device
===========
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
	0	in1	./tests/fake-sys/arena/lego-sensor/sensor0
.

test_infrared_sensor
====================
	0	in1	./tests/fake-sys/arena/lego-sensor/sensor0
.

test_joystick_units
===================
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
	1	outB	./tests/fake-sys/arena/tacho-motor/motor1
.

test_medium_motor
=================
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
.

test_medium_motor_write
=======================
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
.

test_motor_on_for_degrees
=========================
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
.

test_motor_on_for_rotations
===========================
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
.

test_move_tank_relative_distance
================================
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
	1	outB	./tests/fake-sys/arena/tacho-motor/motor1
.

test_steering_large_value
=========================
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
	1	outB	./tests/fake-sys/arena/tacho-motor/motor1
.

test_steering_units
===================
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
	1	outB	./tests/fake-sys/arena/tacho-motor/motor1
.

test_tank_units
===============
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
	1	outB	./tests/fake-sys/arena/tacho-motor/motor1
.

test_units
==========
	0	outA	./tests/fake-sys/arena/tacho-motor/motor0
	1	outB	./tests/fake-sys/arena/tacho-motor/motor1
.
----------------------------------------------------------------------
Ran 12 tests in 0.082s

OK

Comment thread tests/api_tests.py Resolved
@dwalton76

Copy link
Copy Markdown
Collaborator Author

Also fixes #554

Comment thread tests/README.md Resolved
Comment thread tests/README.md Resolved
Comment thread .travis.yml Resolved
@WasabiFan

Copy link
Copy Markdown
Member

Any idea where the . comes from after each test?

@dwalton76

Copy link
Copy Markdown
Collaborator Author

Any idea where the . comes from after each test?

It is printed by unittest

@dwalton76
dwalton76 merged commit 9c95277 into ev3dev:ev3dev-stretch Nov 7, 2018
@dwalton76
dwalton76 deleted the ResourceWarning branch November 7, 2018 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants