BUG: x in MultiIndex.drop(x)
State: closed

- [x] closes #19027 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

  

Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: MultiIndex

Comments:
tests?
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19054?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@e6ea00c`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/19054/graphs/tree.svg?src=pr&token=eZ4WkYLtcO&width=650&height=150)](https://codecov.io/gh/pandas-dev/pandas/pull/19054?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##             master   #19054   +/-   ##
=========================================
  Coverage          ?   91.51%           
=========================================
  Files             ?      148           
  Lines             ?    48783           
  Branches          ?        0           
=========================================
  Hits              ?    44642           
  Misses            ?     4141           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.88% <100%> (?)` | |
| #single | `41.59% <0%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19054?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/reshape.py](https://codecov.io/gh/pandas-dev/pandas/pull/19054/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9yZXNoYXBlLnB5) | `100% <100%> (ø)` | |
| [pandas/core/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/pull/19054/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9tdWx0aS5weQ==) | `96.22% <100%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19054?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19054?src=pr&el=footer). Last update [e6ea00c...a516fcc](https://codecov.io/gh/pandas-dev/pandas/pull/19054?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

cc @toobaz if any comments.
Seems fine, just one question @gitavi : do you know if [this line](https://github.com/pandas-dev/pandas/pull/19054/files#diff-fef81b7e498e469973b2da18d19ff6f3R646) is still needed?
It should no longer be needed since `.get_loc` now `KeyError`s when an empty slice is returned and the new `try, except` handles the `slice_len == 0` case; fixed above.

Additionally, if a boolean mask is returned, it can't possibly be of length 0 because that would require the `MultiIndex` to be length 0 and that would cause any key to `KeyError` and finally I don't think an `int` would ever be returned as it would have errored at `len(loc)` in the original code anyway.
How do I figure out which test the Travis build timed out on? It just says 
`The job exceeded the maximum time limit for jobs, and has been terminated.`
  
EDIT: Nevermind, this is the traceback of the highest exception but there's a bunch of sub-exceptions as well:
```
pytest -s -m single --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml --skip-slow --skip-network pandas
Traceback (most recent call last):
  File "/home/travis/miniconda3/envs/pandas/lib/python3.6/site-packages/_pytest/config.py", line 328, in _getconftestmodules
    return self._path2confmods[path]
KeyError: local('/home/travis/build/pandas-dev/pandas/pandas')
```
Not sure what's going on here...
> How do I figure out which test the Travis build timed out on?

I _think_ there's nothing you can do, I asked in Gitter to restart it.
> It should no longer be needed

👍 
thanks @gitavi 
@gitavi in case you have some idea for #20410 ...