Skip to content

[FIX] Test & Learn: handling memory error#2316

Merged
janezd merged 1 commit intobiolab:masterfrom
jerneju:memory-testlearners
May 25, 2017
Merged

[FIX] Test & Learn: handling memory error#2316
janezd merged 1 commit intobiolab:masterfrom
jerneju:memory-testlearners

Conversation

@jerneju
Copy link
Contributor

@jerneju jerneju commented May 15, 2017

Issue

https://sentry.io/biolab/orange3/issues/218529776/

Description of changes
Includes
  • Code changes
  • Tests
  • Documentation

@jerneju
Copy link
Contributor Author

jerneju commented May 15, 2017

@jerneju jerneju changed the title Test & Learn: handling memory error [FIX] Test & Learn: handling memory error May 15, 2017
@codecov-io
Copy link

codecov-io commented May 16, 2017

Codecov Report

Merging #2316 into master will increase coverage by 0.05%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2316      +/-   ##
==========================================
+ Coverage   73.24%   73.29%   +0.05%     
==========================================
  Files         317      317              
  Lines       55366    55396      +30     
==========================================
+ Hits        40553    40604      +51     
+ Misses      14813    14792      -21

self.send_signal("Data", data)
self.assertFalse(self.widget.Error.memory_error.is_shown())

with unittest.mock.patch("Orange.evaluation.testing.Results.get_augmented_data") as mocked:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    with unittest.mock.patch(
            "Orange.evaluation.testing.Results.get_augmented_data",
            side_effect=MemoryError) as mocked:

This way, it's more obvious why are you mocking.

mocked.side_effect = MemoryError()
self.send_signal("Learner", MajorityLearner(), 0, wait=5000)

self.assertTrue(self.widget.Error.memory_error.is_shown())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this line inside with. Not because it doesn't work outside, but because with kind of groups the test.

@jerneju
Copy link
Contributor Author

jerneju commented May 23, 2017

Fixed.

@janezd janezd merged commit 1add477 into biolab:master May 25, 2017
@jerneju jerneju deleted the memory-testlearners branch May 25, 2017 10:48
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.

3 participants