[issue42535] unittest.patch confuses modules with base modules

2021-07-17 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I've tested this in both 3.7.7 and 3.9.1 and could not reproduce.

--
nosy: +andrei.avk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42535] unittest.patch confuses modules with base modules

2020-12-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42535] unittest.patch confuses modules with base modules

2020-12-02 Thread Tymek Wołodźko

New submission from Tymek Wołodźko :

Nonetheless having several attempts, I wasn't able to create reproducible 
example for this bug, but I will try describing it in detail.

I have a package with multiple modules. One of the paths is like 
`mymodule.nestedmodule.io`, among other functions, this module contains 
functions `foo()` and `bar()`, where `bar()` does call `foo()`. The module 
*does not* import base python's `io` module. I have a unit test that patches:

with path('mymodule.nestedmodule.io.foo'):
bar()


The problem is, when running the test I get the following error: 
`AttributeError:  does not 
have the attribute 'foo'`. The problem is solved when I rename `io` to `myio` 
and correct all the paths to use the new name.

--
components: Library (Lib)
messages: 382303
nosy: twolodzko
priority: normal
severity: normal
status: open
title: unittest.patch confuses modules with base modules
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com