ldtri0209 / robotframework

Automatically exported from code.google.com/p/robotframework
Apache License 2.0
0 stars 0 forks source link

Default Tags, Test Setup, Test Teardown and Test Timeout do not work properly in __init__ files #152

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When above settings are defined in the __init__ file and again in suite
file, every second test gets the value from __init__ file even it should
always get the value from suite file.

Original issue reported on code.google.com by jpran...@gmail.com on 19 Nov 2008 at 9:23

GoogleCodeExporter commented 9 years ago
This is the weirdest bug ever. Juha, will you take a look at this yourself?

How important it actually is that we allow these settings in __init__ files in 
the
first place? Should we remove them in 2.1?

Original comment by pekka.klarck on 19 Nov 2008 at 9:32

GoogleCodeExporter commented 9 years ago
The problem is caused by test suite parent data passed to test cases in a list
without copying it. Tests then say data.reverse later and thus alter the 
original
list. Simple fix is below, but there's room for some more refactoring related 
to this. 

Index: src/robot/running/model.py
===================================================================
--- src/robot/running/model.py  (revision 995)
+++ src/robot/running/model.py  (working copy)
@@ -48,7 +48,7 @@
         self.teardown = utils.get_not_none(suitedata.suite_teardown, [])
         self.suites = [ RunnableTestSuite(suite, parentdatas) 
                         for suite in suitedata.suites ]
-        self.tests = [ RunnableTestCase(test, parentdatas) 
+        self.tests = [ RunnableTestCase(test, parentdatas[:]) 
                        for test in suitedata.tests ]
         if self.name == '':   # suitedata was multisource suite
             self.name = ' & '.join([suite.name for suite in self.suites])

Original comment by pekka.klarck on 19 Nov 2008 at 9:46

GoogleCodeExporter commented 9 years ago
See r996 for fix and r997 for test changes.

Review needed.

Original comment by jpran...@gmail.com on 19 Nov 2008 at 10:55

GoogleCodeExporter commented 9 years ago
Made still some refactoring based on the review. See r1003 for final version.

Original comment by jpran...@gmail.com on 19 Nov 2008 at 1:14

GoogleCodeExporter commented 9 years ago

Original comment by janne.t....@gmail.com on 26 Nov 2008 at 1:03

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 2ac61cc82dfe.

Original comment by jpran...@gmail.com on 16 Mar 2011 at 10:39

GoogleCodeExporter commented 9 years ago
Issue state was accidentally modified by commit messages during Mercurial 
transition.

Original comment by pekka.klarck on 16 Mar 2011 at 12:46