TST: Check float format in object column (#35603)
State: closed

- [ ] closes #35603
- [x] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry

This test checks if a Series cast to object still shows data in float format.

Ran `pytest pandas/tests/series/test_constructors.py`
Output:
```
================================================= test session starts =================================================
platform win32 -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: C:\Users\mdhsi\pandas-michael, configfile: pyproject.toml
plugins: hypothesis-6.12.0, asyncio-0.14.0, cov-2.11.1, forked-1.3.0, instafail-0.4.1, xdist-2.2.1
collected 301 items

pandas\tests\series\test_constructors.py .......................................................................................................................................................................................................x.....................................................................................................

--------------------------- generated xml file: C:\Users\mdhsi\pandas-michael\test-data.xml ---------------------------
================================================ slowest 30 durations =================================================
0.25s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_empty_constructor[<lambda>-True0]
0.13s call     pandas/tests/series/test_constructors.py::TestSeriesConstructorIndexCoercion::test_series_constructor_datetimelike_index_coercion
0.09s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive['dateutil/US/Pacific'-True]
0.04s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_dtype_datetime64_10
0.02s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_empty[OrderedDict]
0.02s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_empty[dict]
0.02s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_cant_cast_datetimelike[PeriodIndex]
0.02s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_cant_cast_datetimelike[DatetimeIndex]
0.02s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_cant_cast_datetimelike[TimedeltaIndex]
0.02s setup    pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_datetimelike_scalar_to_string_dtype[string]
0.02s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_pass_none
0.02s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_categorical_with_coercion
0.02s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_dtype_timedelta64
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive[pytz.FixedOffset(300)-False]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive['Asia/Tokyo'-True]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive[pytz.FixedOffset(300)-True]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive[tzlocal()-False]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive['dateutil/Asia/Singapore'-False]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive[datetime.timezone(datetime.timedelta(seconds=3600))-False]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive[tzutc()-False]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive['+01:15'-True]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive['UTC'-False]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive['UTC-02:15'-True]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive[tzlocal()-True]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive[pytz.FixedOffset(-300)-True]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive['dateutil/Asia/Singapore'-True]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive['UTC'-True]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive['-02:15'-False]
0.01s call     pandas/tests/series/test_constructors.py::TestSeriesConstructors::test_constructor_data_aware_dtype_naive[pytz.FixedOffset(-300)-False]
=========================================== 300 passed, 1 xfailed in 2.22s ============================================
```

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
Hello @mdhsieh! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2021-05-27 17:30:45 UTC
Thanks for the pr @mdhsieh! If you look at the linked issue, we actually want to be testing output formatting, not construction. The test should essentially make sure that printing the series from the issue gives the expected result (hardcoded as a string).
Oh ok, I'll change it. Should the test be moved to `tests/series/test_repr` folder then?
> Oh ok, I'll change it. Should the test be moved to `tests/series/test_repr` folder then?

Either there or `pandas/tests/io/formats/test_format.py`, not 100% sure so whichever looks like it has more similar tests to the one you write. (will be easy to change location once test is written, so don't worry too much about it :)
thanks @mdhsieh