Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 19, 2022
1 parent d357c64 commit b12837c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ What's New in astroid 2.12.3?
=============================
Release date: TBA

* Fix unhandled `FutureWarning` from pandas import in cython modules
* Fix unhandled `FutureWarning` from pandas import in cython modules

Closes #1717

Expand Down
4 changes: 4 additions & 0 deletions tests/fake_module.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt
# This is a mock of a module like Pandas, which can throw warnings for deprecated attributes
def __dir__():
# GH43028
Expand All @@ -8,6 +11,7 @@ def __dir__():

def __getattr__(name):
import warnings

if name == "Float64Index":
warnings.warn("This is what pandas would do", FutureWarning, stacklevel=2)
return 5
Expand Down
2 changes: 1 addition & 1 deletion tests/unittest_raw_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt

import types
import unittest

import _io
import pytest
import types

from astroid.builder import AstroidBuilder
from astroid.const import IS_PYPY
Expand Down

0 comments on commit b12837c

Please sign in to comment.