BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
microscope.testsuite.test_devices.TestBaseDevice Class Reference
Inheritance diagram for microscope.testsuite.test_devices.TestBaseDevice:

Public Member Functions

def test_unexpected_kwargs_raise_exception (self)
 

Detailed Description

Definition at line 504 of file test_devices.py.

Member Function Documentation

◆ test_unexpected_kwargs_raise_exception()

def microscope.testsuite.test_devices.TestBaseDevice.test_unexpected_kwargs_raise_exception (   self)
Unexpected kwargs on constructor raise exception.

Test first that we can construct the device.  Then test that
it fails if there are unused kwargs.  This is an issue when
there are default arguments, there's a typo on the argument
name, and the class uses the default instead of an error.  See
issue #84.

Definition at line 505 of file test_devices.py.

505 def test_unexpected_kwargs_raise_exception(self):
506 """Unexpected kwargs on constructor raise exception.
507
508 Test first that we can construct the device. Then test that
509 it fails if there are unused kwargs. This is an issue when
510 there are default arguments, there's a typo on the argument
511 name, and the class uses the default instead of an error. See
512 issue #84.
513 """
514 simulators.SimulatedLightSource()
515 # XXX: Device.__del__ calls shutdown(). However, if __init__
516 # failed the device is not complete and shutdown() fails
517 # because the logger has not been created. See comments on
518 # issue #69. patch __del__ to workaround this issue.
519 with unittest.mock.patch("microscope.devices.Device.__del__"):
520 with self.assertRaisesRegex(TypeError, "argument 'power'"):
521 simulators.SimulatedLightSource(power=2)
522
523

The documentation for this class was generated from the following file: