Skip to content

Problem with #doctest: +FLOAT_CMP on Windows Py 2.6 ? #3853

Description

@taldcroft

PR #3731 at ed8a3e1 failed only on Windows Py 2.6 with an exception in doc testing. There were no other test failures on any platform / configuration. I don't have a Windows platform to debug or try to reproduce.

Here is the log:

https://ci.appveyor.com/project/Astropy/astropy/build/1.0.1509/job/65hvtqa4x4h7m3b6

And the error at the end:

================================== FAILURES =================================== 
_________________________ [doctest] access_table.rst __________________________ 
_pytest.runner:137: in __init__ 
>   ??? 
_pytest.runner:124: in <lambda> 
>   ??? 
_pytest.main:161: in call_matching_hooks 
>   ??? 
_pytest.core:380: in pcall 
>   ??? 
_pytest.core:387: in _docall 
>   ??? 
_pytest.core:288: in execute 
>   ??? 
_pytest.runner:86: in pytest_runtest_call 
>   ??? 
astropy\tests\pytest_plugins.py:156: in runtest 
>           raise_on_error=True, verbose=False, encoding='utf-8') 
C:\conda\envs\test\lib\doctest.py:1973: in testfile 
>       runner.run(test) 
C:\conda\envs\test\lib\doctest.py:1736: in run 
>       r = DocTestRunner.run(self, test, compileflags, out, False) 
C:\conda\envs\test\lib\doctest.py:1391: in run 
>           return self.__run(test, compileflags, out) 
C:\conda\envs\test\lib\doctest.py:1269: in __run 
>               if check(example.want, got, self.optionflags): 
astropy\tests\output_checker.py:154: in check_output 
>           return self.normalize_floats(want, got, flags) 
astropy\tests\output_checker.py:117: in normalize_floats 
>           got = got % tuple(nw_) 
E           TypeError: a float is required 
 1 failed, 9031 passed, 111 skipped, 78 xfailed, 2 xpassed in 1118.24 seconds = 
Command exited with code 1

Activity

  1. embray commented on Jun 15, 2015

    @embray
    Member

    Weird--could you point me to the specific test that's failing? It could be a quirk in the platform float parsing. The value in the nw_ variable should be a float string.

  2. taldcroft commented on Jun 15, 2015

    @taldcroft
    MemberAuthor

    @embray - unfortunately I can only narrow it down to one of three tests. As you can see in 8c850ef I just skipped all three of the FLOAT_CMP tests and it then passed on windows. I don't have a Windows platform to try reproducing and/or skipping one at a time.

    If called as a function then one can supply an ``option`` that specifies
    the type of information to return.  The built-in ``option`` choices are
    ``attributes`` (column attributes, which is the default) or ``stats``
    (basic column statistics).  The ``option`` argument can also be a list
    of available options::
    
      >>> t.info('stats')  # doctest: +FLOAT_CMP
      <Table length=5>
      name mean      std      min max
      ---- ---- ------------- --- ---
         a  6.0 4.24264068712   0  12
         b  7.0 4.24264068712   1  13
         c  8.0 4.24264068712   2  14
    
      >>> t.info(['attributes', 'stats'])  # doctest: +FLOAT_CMP
      <Table length=5>
      name dtype   unit   format       description        mean      std      min max
      ---- ----- -------- ------ ------------------------ ---- ------------- --- ---
         a int32 m sec^-1  %6.3f unladen swallow velocity  6.0 4.24264068712   0  12
         b int32                                           7.0 4.24264068712   1  13
         c int32                                           8.0 4.24264068712   2  14
    
    Columns also have an ``info`` property that has the behavior and arguments,
    but provides information about a single column::
    
      >>> t['a'].info
      name = a
      dtype = int32
      unit = m sec^-1
      format = %6.3f
      description = unladen swallow velocity
      class = Column
      n_bad = 0
      length = 5
    
      >>> t['a'].info('stats')  # doctest: +FLOAT_CMP
      name = a
      mean = 6.0
      std = 4.24264068712
      min = 0
      max = 12
      n_bad = 0
      length = 5
    
  3. embray commented on Jun 15, 2015

    @embray
    Member

    That's fine, I should be able to get to the bottom of this.

  4. self-assigned this
    on Jun 15, 2015
  5. astrofrog commented on Jan 29, 2016

    @astrofrog
    Member

    @taldcroft - do you know if this is a problem on Python 2.7 too? Since we don't support Python 2.6, maybe this can be closed?

  6. added
    Close?Tell stale bot that this issue/PR is stale
    on Jan 29, 2016
  7. embray commented on Jan 29, 2016

    @embray
    Member

    This wouldn't be an issue on Python 2.7. However, before closing this the tests that @taldcroft marked skip in 2cfaf55 can be re-enabled.

  8. taldcroft commented on Feb 10, 2016

    @taldcroft
    MemberAuthor

    @embray @astrofrog - #4594 will test whether this is now working in our current test suite.

  9. embray commented on May 23, 2016

    @embray
    Member

    Since we're dropping Python 2.6 support anyways this can be closed.

  10. embray commented on May 23, 2016

    @embray
    Member

    Actually #4594 hasn't been merged yet so this should be left open I guess. Any reason for the delay on that?

  11. reopened this on May 23, 2016
  12. astrofrog commented on May 23, 2016

    @astrofrog
    Member

    @embray - yes, #4594 is failing on AppVeyor, meaning that the fix was likely needed for other Python versions too, or that at least something is not quite right in that PR.

  13. astrofrog commented on Jan 16, 2017

    @astrofrog
    Member

    @taldcroft - can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions