Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for refleak tests #45755

Closed
tiran opened this issue Nov 9, 2007 · 11 comments
Closed

Fix for refleak tests #45755

tiran opened this issue Nov 9, 2007 · 11 comments
Assignees

Comments

@tiran
Copy link
Member

tiran commented Nov 9, 2007

BPO 1414
Nosy @gvanrossum, @tiran
Files
  • py3k_reftestfix.patch
  • py3k_reftestfix2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/gvanrossum'
    closed_at = <Date 2007-11-30.23:18:30.589>
    created_at = <Date 2007-11-09.15:17:05.740>
    labels = []
    title = 'Fix for refleak tests'
    updated_at = <Date 2008-01-06.22:29:45.190>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2008-01-06.22:29:45.190>
    actor = 'admin'
    assignee = 'gvanrossum'
    closed = True
    closed_date = <Date 2007-11-30.23:18:30.589>
    closer = 'christian.heimes'
    components = []
    creation = <Date 2007-11-09.15:17:05.740>
    creator = 'christian.heimes'
    dependencies = []
    files = ['8720', '8721']
    hgrepos = []
    issue_num = 1414
    keywords = ['patch']
    message_count = 11.0
    messages = ['57310', '57315', '57321', '57414', '57419', '57420', '57422', '57999', '58016', '58018', '58029']
    nosy_count = 2.0
    nosy_names = ['gvanrossum', 'christian.heimes']
    pr_nums = []
    priority = 'low'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1414'
    versions = ['Python 3.0']

    @tiran
    Copy link
    Member Author

    tiran commented Nov 9, 2007

    The patch prevents some tests from running multiple times in a test session.

    @gvanrossum
    Copy link
    Member

    Hm, I was hoping more for patches to the C code that would make these
    initializations reentrant (e.g. by testing a flag in C that says "I'm
    already initialized").

    @tiran
    Copy link
    Member Author

    tiran commented Nov 9, 2007

    Here is a version of test_freeze that doesn't depend on stdout output on
    load.

    @gvanrossum
    Copy link
    Member

    Please check in the frozen-related fixes.

    Your changes to test_tcl break that test even when run without -R!

    For test_pkg, I would rather see a fix that undoes all the changes to
    sys.modules (note that it already restores sys.path and deletes the
    files it's created, but that's not enough).

    @tiran
    Copy link
    Member Author

    tiran commented Nov 12, 2007

    How do you like;

    class TestPkg(unittest.TestCase):
    
        def setUp(self):
            self.root = None
            self.syspath = list(sys.path)
            self.sysmodules = sys.modules.copy()
    
        def tearDown(self):
            sys.path[:] = self.syspath
            sys.modules.clear()
            sys.modules.update(self.sysmodules)
            del self.sysmodules
            cleanout(self.root)

    Or I could use the paranoid approach: create set from sys.modules.keys()
    in setUp + tearDown and remove the items that are in the second set but
    not in the first set.

    @tiran
    Copy link
    Member Author

    tiran commented Nov 12, 2007

    Fix for test_frozen comitted in r58953

    @gvanrossum
    Copy link
    Member

    If that makes the test pass with and without -R::, go for it!

    On Nov 12, 2007 11:14 AM, Christian Heimes <report@bugs.python.org> wrote:

    Christian Heimes added the comment:

    How do you like;

    class TestPkg(unittest.TestCase):

    def setUp(self):
        self.root = None
        self.syspath = list(sys.path)
        self.sysmodules = sys.modules.copy()
    
    def tearDown(self):
        sys.path[:] = self.syspath
        sys.modules.clear()
        sys.modules.update(self.sysmodules)
        del self.sysmodules
        cleanout(self.root)
    

    Or I could use the paranoid approach: create set from sys.modules.keys()
    in setUp + tearDown and remove the items that are in the second set but
    not in the first set.


    Tracker <report@bugs.python.org>
    <http://bugs.python.org/issue1414\>


    @gvanrossum
    Copy link
    Member

    ping?

    @tiran
    Copy link
    Member Author

    tiran commented Nov 30, 2007

    I don't know how to fix the problem. You have to assign the bug to
    somebody who has experience with Tcl/Tk.

    @gvanrossum
    Copy link
    Member

    Can you open a separate item for the Tkinter leak so you can close this one?

    @tiran
    Copy link
    Member Author

    tiran commented Nov 30, 2007

    The bug report for test_tcl is at http://bugs.python.org/issue1532

    @tiran tiran closed this as completed Nov 30, 2007
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    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

    No branches or pull requests

    2 participants