def test_findNonModule(self):
        """
        findByName, if given something findable up until the last entry, will
        raise AttributeError (as it cannot tell if 'nonexistent' here is
        supposed to be a module or a class).
        """
        self.assertRaises(
            AttributeError, self.loader.findByName,
            'twisted.trial.test.nonexistent'
        )

        findByName, if given something findable up until the last entry, will
        raise AttributeError (as it cannot tell if 'nonexistent' here is
        supposed to be a module or a class).
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_loader.py