← Back to team overview

sikuli-driver team mailing list archive

[Bug 620598] Re: X-1.0rc3: UnitTest: from __future__ fails in unit test script

 

** Changed in: sikuli
       Status: Confirmed => Fix Released

** Changed in: sikuli
       Status: Fix Released => Fix Committed

** Changed in: sikuli
     Assignee: (unassigned) => RaiMan (raimund-hocke)

** Changed in: sikuli
   Importance: Undecided => Low

** Changed in: sikuli
    Milestone: None => x1.0

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/620598

Title:
  X-1.0rc3: UnitTest: from __future__ fails in unit test script

Status in Sikuli:
  Fix Committed

Bug description:
  **** solution/workaround:

  This was fixed in the sense that you don't need to import
  with_statement anymore. It is imported automatically.

  from __future__ import ... does not work in current IDE Test environment
  ------------------------------------------------------------------------

  When a test script is run (from the Run button in the Testing pane)
  that uses a "from __future__" import, it gives:

  Exception in thread "AWT-EventQueue-0" SyntaxError: ('from __future__
  imports must occur at the beginning of the file', ('<string>', 11, 1,
  ''))

  Sample script:

  from __future__ import with_statement

  def test_file_not_empty(self):
      with open('myfile.txt') as myfile:
          assert(len(myfile.read())) > 0

  32-bit Ubuntu 10.04, Sikuli 0.10.2

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/620598/+subscriptions